using UnityEngine;
using System.Collections;

public class GameManager : MonoBehaviour {
	
	public			GameGUI			m_GUI;
	public			Switching		m_Switcher;
	public			TimeBar			m_AlphaBar;
	public			TimeBar			m_BetaBar;
	
	void Start () 
	{
		m_GUI = GameObject.Find("GameGUI").GetComponent("GameGUI") as GameGUI;
		m_Switcher = GameObject.Find("Switching").GetComponent("Switching") as Switching;
		m_AlphaBar = GameObject.Find("TimeBarAlpha").GetComponent("TimeBar") as TimeBar;
		m_BetaBar = GameObject.Find("TimeBarBeta").GetComponent("TimeBar") as TimeBar;
	}
	
	void Update ()
	{
		if (!m_Switcher.AlphaMove.m_Freeze)
			m_GUI.TimeBar(m_AlphaBar);
		else if (!m_Switcher.BetaMove.m_Freeze)
			m_GUI.TimeBar(m_BetaBar);
	}
	
	void OnGUI()
	{
		m_GUI.Show();	
	}
}
